package server;

/**
 * @author 陶肖寅
 * @version V1.0
 * @Package server
 * @date 2020-02-24 13:44
 * @Copyright © 2020-2021 城云科技(中国)有限公司
 */
public abstract class HttpServlet implements Servlet {
    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request, Response response);

    @Override
    public void service(Request request, Response response) {
        if("get".equalsIgnoreCase(request.getMethod())){
            doGet(request,response);
        } else {
            doPost(request,response);
        }
    }
}
